package Date;

import java.util.Calendar;
import java.util.Scanner;

public class 二月天 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入年份");
        int year = sc.nextInt();

        //设置日历对象的年，月，日
        Calendar c = Calendar.getInstance();
        c.set(year, 2, 1);

        //三月一日往前推一天，就是二月最后一天
        c.add(Calendar.DATE, -1);
        int date = c.get(Calendar.DATE);

        System.out.println(year + "这年的二月份有" + date + "天");
    }

}
